<?php
namespace frontend\components;

use yii\base\Widget;
use yii\helpers\Html;

class RctCreditdetailWidget extends Widget
{
	public $recentCreditdetails;
	
	public function init()
	{
		parent::init();
	}
	
	public function run()
	{
		$creditdetailString='';
		$count=0;
		foreach ($this->recentCreditdetails as $creditdetail)
		{
			$count++;
			$creditdetailString.='<div class="doc">'.
					'<table width="100%"><tr>'.'<h4>'.
					'<td width="10%"><h4><span style="font-style:italic;">'.
					nl2br($count).'</span></h4></td>'.
					'<td width="10%"> <h4><span class="glyphicon glyphicon-user" aria-hidden="ture">
							</span></h4></td><td width="40%"><h4> '.Html::encode($creditdetail->username).'</h4></td>'.
					
					'<td width="40%" align="center"><h4>
							'.Html::encode($creditdetail->credit).'</h4></td>'.
					'<hr></h4></tr></table></div>';
		}
		return  $creditdetailString;
	}
}